package me.zhengjie.common.utils

import jakarta.servlet.http.HttpServletRequest
import org.springframework.web.context.request.RequestContextHolder
import org.springframework.web.context.request.ServletRequestAttributes
import java.util.*


/**
 * 获取 HttpServletRequest
 * @author Kuki Wu
 * @date 2024-11-24
 */
object RequestHolder {
    val httpServletRequest: HttpServletRequest
        get() = (Objects.requireNonNull(RequestContextHolder.getRequestAttributes()) as ServletRequestAttributes).request
}